package tij4.concurrent.exercise.ex16;

import java.util.concurrent.locks.ReentrantLock;

public class LockTest {
    private ReentrantLock lock = new ReentrantLock();

    public void fun1() {
        lock.lock();
        try {
            while (true) {
                System.out.println("fun1()");
            }
        }finally {
            lock.unlock();
        }
    }

    public void fun2() {
        lock.lock();
        try {
            while (true) {
                System.out.println("fun2()");
            }
        }finally {
            lock.unlock();
        }
    }

    public void fun3() {
        lock.lock();
        try {
            while (true) {
                System.out.println("fun3()");
            }
        }finally {
            lock.unlock();
        }
    }
}
